//
//  VideoView.h
//  UniversallyFramework
//
//  Created by liuf on 15/9/10.
//  Copyright (c) 2015年 liuf. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ContentModel.h"
#import "VideoPlayControlView.h"
#import <AVFoundation/AVFoundation.h>

@class XRVideoPlayer;

@protocol VideoViewDelegate <NSObject>

@required
-(void)videoFullScreentt; // enter to full screen
-(void)backVideoFullScreen; // bakc to full screen

@optional
- (void)onDidPlaySeries:(int)index; // after did play series
- (void)onDidPlayMultiContentVideo:(int)index; // after did play multi content video

- (void)playDone; // after the video is play done
- (void)videoPlayingChange:(BOOL)isPlaying;

@end

@interface VideoView : UIView<VideoPlayControlViewDelegate>

@property (nonatomic, strong) XRVideoPlayer *player;

@property (nonatomic, assign) long long startTime;
@property (nonatomic, assign) long long endTime;
@property (nonatomic, assign) long long startTimeOffset;
@property (nonatomic, assign) double currentPlayBackTime;
@property (nonatomic, weak) id<VideoViewDelegate>delegate;
@property (nonatomic, assign) BOOL isShot;//是否是随手拍;
@property (nonatomic, assign) BOOL isNotVolume;//是否是随手拍;
@property (nonatomic, assign) CGFloat videoWidth;
@property (nonatomic, assign) CGFloat videoHeight;

@property (nonatomic, assign) BOOL isNews;

// 视频当前方向
@property (nonatomic, assign) UIDeviceOrientation videoCurrentOrientation;

/**
 *  添加视频和音频同时存在时点击播放音频的方法
 *
 *  @param isPlay TRUE播放 FALSE暂停
 */
-(void)playerPlayOrPause:(BOOL)isPlay;

/**
 * 添加手势/隐藏声音提示
 */

- (void)addpanGestureOrVoluemImageView;

/**
 *  播放内容中的视频
 *
 *  @param contentModel 内容模型
 */
-(void)playContent:(ContentModel *)contentModel;
/**
 *  播放剧集
 *
 *  @param contentModel 内容模型 包含剧集字段series_list
 *  @param index        播放第几集
 */
-(void)playSeries:(ContentModel *)contentModel index:(int)index;
/**
 *  播放随手拍
 *
 *  @param stringURL 随手拍URL
 */
-(void)playShotLive:(NSString *)stringURL;

/**
 *  返回，会删除监听，删除播放器
 */
-(void)back;
/**
 *  获得当前播放时长
 *
 *  @return 播放时长
 */
-(CMTime)getCurrentPlaybackTime;

/**
 *  获取当前播放地址
 *
 *  @return 当前播放地址
 */
-(NSString *)getCurrentPlayUrl;
// 退出播放器
-(void)cancel;

//视图
- (void)stopLoadAnimation;

/**
 *  根据视图大小来进入全屏或者退出全屏
 *
 */
-(void)refreshUI:(BOOL )isFullScreen isFromGraphicLive:(BOOL)isFromGraphicLive;

/**
 *  进入后台
 */
-(void)appGoBackground;

/**
 *  进入前台
 */
- (void)appGoForeground;

//交叉播放的时候设置音量
- (void)setVolume:(float)volume;

//播放 暂停
- (void)play;
- (void)pause;




@end
